import request from '@/utils/request'

 //API常量
 const APIS = {
  V1: "/v1"
}

export function repayInfoList(conditions) {
  return request({
    url: APIS.V1+`/system/repayPlan/repayInfoList`,
    method: 'get',
    params: conditions
  })
}

export function createRepayPlan(data) {
  return request({
    url: APIS.V1+`/system/repay/plan/add`,
    method: 'post',
    data
  })
}

export function listLoanStatus() {
  return request({
    url: APIS.V1+`/system/repayPlan/listLoanStatus`,
    method: 'get'
  })
}

// 还款计划列表
export function listRepayPlan(data) {
  return request({
    url: APIS.V1+`/system/repayPlan/listRepayPlan`,
    method: 'get',
    params:data
  })
}
// 上传还款计划
// export function uploadRepayPlan11(data) {
//   alert(111);
//   console.log(data)
//   return request({
//     url: APIS.V1+`/system/repayPlan/uploadRepayPlan`,
//     method: 'post',
//     data
//   })
// }

export function upload(data) {
  return request({
    url: APIS.V1+`/system/repayPlan/uploadRepayPlan`,
    method: 'post',
    data
  })
}

export function addRepayRecord(data) {
  return request({
    url: APIS.V1+`/system/repayPlan/addRepayRecord`,
    method: 'post',
    data
  })
}

export function advancePayment(data) {
  return request({
    url: APIS.V1+`/system/repayPlan/advancePayment`,
    method: 'post',
    data
  })
}

// #分页查询还款记录
export function listRepayRecord(conditions) {
  return request({
    url: APIS.V1+`/system/repayPlan/listRepayRecord`,
    method: 'get',
    params: conditions
  })
}
// #分页查询还款记录
export function getProjectNoAmountAndInterest(conditions) {
  return request({
    url: APIS.V1+`/system/repayPlan/getProjectNoAmountAndInterest`,
    method: 'get',
    params: conditions
  })
}

// 台账下载
export function downloadRepayStand(params) {
  console.log(111)
  console.log(params)
  return request({
    url: APIS.V1 + `/system/repayPlan/downloadRepayStand`,
    method: 'get',
    params:params,
    responseType: 'blob'
  })
}

const uploadRepayPlan = process.env.VUE_APP_BASE_API + '/v1/system/repayPlan/uploadRepayPlan'
export { uploadRepayPlan }
